{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "data": {
      "text/plain": "[1200, 1800, 2520, 3360, 4320, 5400, 6600, 7920, 9360, 10920, 12600, 14400]"
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import linear_model as model\n",
    "import src.project1.submit.AI as ai\n",
    "from experiment.评估函数.simulator import Simulator\n",
    "from experiment.评估函数.greedy_ai import GreedyAI\n",
    "from experiment.评估函数.greedys import *\n",
    "import numpy as np\n",
    "\n",
    "chessboard_size = 8\n",
    "time_out = 5\n",
    "\n",
    "\n",
    "def greedy_fun(Vars):\n",
    "    PVT, PVT_max = model.get_PVT_and_max(Vars)\n",
    "    return lambda a, p: model.value_of_positions(a.reversi_env.updated_chessboard(a.chessboard, a.color, p), a.color,\n",
    "                                                 PVT, PVT_max)\n",
    "\n",
    "\n",
    "baselines = [random_baseline, middle_action_first, map_weight_sum]\n",
    "baseline_cnt = len(baselines)\n",
    "# 注意时间复杂度不要太高\n",
    "落子次数 = lambda x : (baseline_cnt + x) * (baseline_cnt-1 + x) * 60\n",
    "[落子次数(i) for i in range(2, 14)]  # 已知落子 60*30 = 1800 需要1.59276s\n",
    "# 选择15s 一个温度，有 10000次以上，"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [],
   "source": [
    "import random\n",
    "import time\n",
    "\n",
    "def simulated_annealing(state, T=1, log_interval=10, neighbour_cnt=10):\n",
    "    start_time = time.time()\n",
    "    t = 0  # time step\n",
    "    f = []  # a recording of values\n",
    "    while T >= 1e-7:\n",
    "        vars_list = model.neighbours_continuous(state, -1, 1, 0.1, neighbour_cnt)\n",
    "        funcs = baselines + list(map(greedy_fun, vars_list))\n",
    "        length = len(funcs)\n",
    "        matches = 2/2*length*(length-1)\n",
    "        scores = np.zeros(length)\n",
    "        for i in range(length):\n",
    "            for j in range(i + 1, length):\n",
    "                for i_color in [ai.COLOR_BLACK, ai.COLOR_WHITE]:\n",
    "                    agents = {i_color: GreedyAI(chessboard_size, i_color, funcs[i]),\n",
    "                              -i_color: GreedyAI(chessboard_size, -i_color, funcs[j])}\n",
    "                    simulator = Simulator(chessboard_size, time_out, agents)\n",
    "                    winner = simulator.quick_run(no_print=True)\n",
    "                    if winner == i_color:\n",
    "                        scores[i] += 1\n",
    "                    elif winner == -i_color:\n",
    "                        scores[j] += 1\n",
    "        diff = np.inf\n",
    "        new_idx = -1\n",
    "        new_value = np.nan\n",
    "        while not (diff > 0 or np.exp(diff / T) > np.random.uniform()):\n",
    "            new_idx = random.randint(1, neighbour_cnt)\n",
    "            new_value = scores[new_idx]\n",
    "            diff = new_value - scores[0]\n",
    "\n",
    "        state = vars_list[new_idx]\n",
    "        f.append(new_value)\n",
    "        # update time and temperature\n",
    "        if t % log_interval == 0:\n",
    "            print(f\"step {t}: T={T}, current_value={scores[new_idx]/matches}, time used: {time.time()-start_time}\")\n",
    "            print(f\"Current var is {state}\")\n",
    "        t += 1\n",
    "        T = 0.999 ** t\n",
    "    print(f\"step {t}: T={T}, current_value={scores[new_idx]/matches}\")\n",
    "    return state, f"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "step 0: T=1, current_value=0.10714285714285714, time used: 4.05219030380249\n",
      "Current var is [-0.89561378  1.         -0.19137715 -0.30143643  0.90671003 -0.24745839\n",
      " -0.14145017 -0.23293248  0.53537761 -0.12872306]\n",
      "step 10: T=0.9900448802097482, current_value=0.10714285714285714, time used: 32.04831790924072\n",
      "Current var is [-0.84644473  0.87280518  0.02534043 -0.3556755   0.97759364 -0.56621937\n",
      " -0.02188858 -0.27254562  0.98973532  0.16321912]\n",
      "step 20: T=0.9801888648295347, current_value=0.03571428571428571, time used: 59.4508695602417\n",
      "Current var is [-0.81753312  0.42876027 -0.29537373 -0.25230171  0.69330562 -0.49365052\n",
      "  0.60343311 -0.32361499  0.64940336 -0.10335152]\n",
      "step 30: T=0.9704309672630858, current_value=0.08928571428571429, time used: 87.02612280845642\n",
      "Current var is [-0.75074206  0.30397095 -0.61978262 -0.80060076  0.37218739 -0.6072005\n",
      "  0.99951262 -0.21673295  0.42623422 -0.22120175]\n",
      "step 40: T=0.9607702107358118, current_value=0.05357142857142857, time used: 114.82277798652649\n",
      "Current var is [-0.40764708  0.07481015 -0.74338088 -1.          0.85027908 -0.53286981\n",
      "  0.65231511  0.12459889  0.3275257  -0.47620293]\n",
      "step 50: T=0.9512056281970314, current_value=0.05357142857142857, time used: 143.1819405555725\n",
      "Current var is [-0.54107579  0.00614056 -0.59751625 -0.44934812  0.96140832 -0.90849082\n",
      "  0.23442846  0.08876162  0.13005458 -0.90740265]\n",
      "step 60: T=0.9417362622231682, current_value=0.125, time used: 171.01151180267334\n",
      "Current var is [-0.83646737 -0.41689443 -0.9409037  -0.80255302  1.         -0.90137085\n",
      "  0.42325098 -0.04967567  0.17671651 -0.78056564]\n",
      "step 70: T=0.9323611649219126, current_value=0.14285714285714285, time used: 199.19812655448914\n",
      "Current var is [-0.43308728 -0.77665903 -0.5332239  -0.68783444  0.90104637 -0.29281834\n",
      "  0.59839116  0.43333678  0.36559139 -0.67258467]\n",
      "step 80: T=0.9230793978373362, current_value=0.10714285714285714, time used: 227.60615277290344\n",
      "Current var is [-0.87302593 -0.99577416 -0.60340673 -0.5374088   0.81206756 -0.08634212\n",
      "  1.          0.59728751  0.5181562  -0.52821353]\n",
      "step 90: T=0.913890031855952, current_value=0.14285714285714285, time used: 255.15347409248352\n",
      "Current var is [-0.7829298  -0.56495621 -0.52349772 -0.55127026  0.20131952 -0.09800899\n",
      "  1.          0.71300131  0.6200111  -0.30858906]\n",
      "step 100: T=0.9047921471137089, current_value=0.07142857142857142, time used: 282.6878366470337\n",
      "Current var is [-0.71127931 -0.25273938 -0.43607698 -0.60595037  0.27110332 -0.17467187\n",
      "  0.7545685   0.60701449  1.         -0.37503977]\n",
      "step 110: T=0.8957848329039129, current_value=0.10714285714285714, time used: 310.16138672828674\n",
      "Current var is [-0.63548288 -0.42883301 -0.47288605 -0.06883264  0.01780438 -0.26967586\n",
      "  0.80492428  0.51525338  0.88562249 -0.40425148]\n",
      "step 120: T=0.8868671875860638, current_value=0.08928571428571429, time used: 337.77650451660156\n",
      "Current var is [-0.8328123  -0.45373739 -0.60352853  0.08217701 -0.12585778 -0.47593974\n",
      "  0.75412671  0.97920902  0.5506383  -0.79931475]\n",
      "step 130: T=0.8780383184956008, current_value=0.05357142857142857, time used: 365.7078034877777\n",
      "Current var is [-1.         -0.53236322 -0.47454986 -0.09147668 -0.21003626 -0.64723559\n",
      "  0.81661562  0.46413977  0.54921685 -0.8024724 ]\n",
      "step 140: T=0.8692973418545458, current_value=0.05357142857142857, time used: 393.61616373062134\n",
      "Current var is [-0.80049026 -0.56206258  0.10827043 -0.0696038  -0.26724351 -0.91117778\n",
      "  0.77564743  0.90764234  0.97712486 -1.        ]\n",
      "step 150: T=0.8606433826830363, current_value=0.19642857142857142, time used: 421.492609500885\n",
      "Current var is [-0.50424843 -0.15599491  0.40646879  0.24759448 -0.53642968 -0.71653303\n",
      "  0.65201038  1.          0.3604244  -0.85601487]\n",
      "step 160: T=0.8520755747117391, current_value=0.10714285714285714, time used: 449.3511018753052\n",
      "Current var is [-0.60628564 -0.08615616  0.29826119  0.76619129 -0.52811932 -0.6858701\n",
      "  0.6098129   0.39891205  0.23999361 -0.82949808]\n",
      "step 170: T=0.8435930602951361, current_value=0.125, time used: 477.27043414115906\n",
      "Current var is [-0.21025725  0.56547987  0.36760755  0.58642569 -0.44506327 -0.09219007\n",
      "  0.55965901 -0.2554302   0.14411777 -1.        ]\n",
      "step 180: T=0.8351949903256729, current_value=0.125, time used: 504.9125053882599\n",
      "Current var is [ 0.27784397  0.40285392  0.72160258  0.03504494 -0.58000507 -0.50476063\n",
      "  0.04307784 -0.11569271  0.21456731 -0.69127902]\n",
      "step 190: T=0.8268805241487627, current_value=0.08928571428571429, time used: 532.2284514904022\n",
      "Current var is [-0.03684648  0.41785621  0.70589587  0.07710137 -0.78649903 -0.55413139\n",
      "  0.1721239  -0.08397819  0.31171899 -0.72557992]\n",
      "step 200: T=0.8186488294786356, current_value=0.08928571428571429, time used: 559.7408707141876\n",
      "Current var is [ 0.17500292  0.92925898  0.77555041  0.20251769 -0.24061879 -0.40033528\n",
      "  0.48059729  0.06266665  0.3746056  -0.90697929]\n",
      "step 210: T=0.8104990823150263, current_value=0.10714285714285714, time used: 587.7280189990997\n",
      "Current var is [ 0.70524162  0.98447665  0.77581834  0.1572231  -0.44719854 -0.42482908\n",
      "  0.63619178  0.13777687  0.2881922  -1.        ]\n",
      "step 220: T=0.8024304668606911, current_value=0.16071428571428573, time used: 615.7151687145233\n",
      "Current var is [ 0.51982217  0.8202993   0.57546604 -0.17545053 -0.6116179  -0.41012347\n",
      "  0.85810602  0.23289089  0.62026718 -1.        ]\n",
      "step 230: T=0.7944421754397453, current_value=0.07142857142857142, time used: 643.7153472900391\n",
      "Current var is [ 0.05179544  1.          0.50861836 -0.07432884 -0.18820474 -0.39576798\n",
      "  0.59068693 -0.20014357  0.61143818 -1.        ]\n",
      "step 240: T=0.7865334084168143, current_value=0.125, time used: 671.8680868148804\n",
      "Current var is [-0.07440124  0.86507463  0.75507085 -0.25583495 -0.1089228  -0.51560392\n",
      "  0.53990277 -0.52818064  0.55177525 -0.98263587]\n",
      "step 250: T=0.7787033741169899, current_value=0.07142857142857142, time used: 699.9240539073944\n",
      "Current var is [-0.16128914  0.85784321  0.62181522  0.30472625 -0.06576484 -0.26430232\n",
      "  0.34949553 -0.34771062  0.53393096 -0.82065196]\n",
      "step 260: T=0.770951288746582, current_value=0.125, time used: 727.8812820911407\n",
      "Current var is [ 0.19823047  0.81820175  0.67196444  0.22457286 -0.15403584 -0.7780202\n",
      "  0.71983807  0.01210312  0.5079268  -0.98117022]\n",
      "step 270: T=0.7632763763146607, current_value=0.03571428571428571, time used: 755.6959211826324\n",
      "Current var is [-0.11119118  0.82307324  0.33377662  0.80155055  0.01510986 -0.42396318\n",
      "  0.95009612  0.19023178  0.65974598 -0.67724282]\n",
      "step 280: T=0.755677868555379, current_value=0.125, time used: 783.4995350837708\n",
      "Current var is [ 0.08821512  0.64496478  0.04880224  0.52823414 -0.04317774 -0.16172734\n",
      "  0.95180305  0.48805177  0.62622724 -0.64938903]\n",
      "step 290: T=0.7481550048510681, current_value=0.10714285714285714, time used: 811.1555690765381\n",
      "Current var is [-0.25148419  0.65321802  0.13249606  0.49507784 -0.41786272  0.00653258\n",
      "  0.72187788  0.38759215  0.73378026 -0.96419936]\n",
      "step 300: T=0.7407070321560992, current_value=0.10714285714285714, time used: 839.3002984523773\n",
      "Current var is [-0.72902227 -0.08301603  0.07668519  0.58317238 -0.3118726  -0.15589473\n",
      "  0.84831994  0.87737297  0.57976879 -0.91554346]\n",
      "step 310: T=0.7333332049215034, current_value=0.08928571428571429, time used: 867.3981816768646\n",
      "Current var is [-0.74556879 -0.14030272 -1.          0.69550705 -0.20596646  0.30858526\n",
      "  0.7247347   0.63738884  0.57619941 -0.96031429]\n",
      "step 320: T=0.7260327850203405, current_value=0.08928571428571429, time used: 894.9295506477356\n",
      "Current var is [-0.91036078 -0.08637315 -1.          0.93042105 -0.31552476 -0.02188335\n",
      "  0.98184338  0.5223923   0.74740683 -0.74793377]\n",
      "step 330: T=0.718805041673813, current_value=0.07142857142857142, time used: 922.1088309288025\n",
      "Current var is [-1.          0.09572812 -1.          1.         -0.11936627 -0.09817973\n",
      "  0.9368945   0.69112018  1.         -0.2006035 ]\n",
      "step 340: T=0.7116492513781132, current_value=0.10714285714285714, time used: 949.3958530426025\n",
      "Current var is [-0.81908947 -0.47851886 -0.94257549  0.89360697  0.13532396 -0.17949403\n",
      "  0.58509992  0.31362211  0.60479087 -0.21057339]\n",
      "step 350: T=0.704564697832001, current_value=0.08928571428571429, time used: 976.6070764064789\n",
      "Current var is [-0.66966791 -0.5598294  -0.81129998  0.97126163 -0.32580511 -0.49773101\n",
      "  0.35530682  0.59235174  0.00440049 -0.37495946]\n",
      "step 360: T=0.6975506718651009, current_value=0.08928571428571429, time used: 1004.2341902256012\n",
      "Current var is [-0.52399286 -0.53090447 -0.82944993  0.75529889 -0.7784596  -0.32981457\n",
      "  0.45248698  0.48211197 -0.55533376 -0.03112371]\n",
      "step 370: T=0.6906064713669132, current_value=0.10714285714285714, time used: 1031.5202150344849\n",
      "Current var is [-0.54321174 -0.65269587 -0.56311074  0.81759673 -0.96563813  0.05037092\n",
      "  0.1384977   0.52703235 -0.53571691 -0.21950214]\n",
      "step 380: T=0.6837314012165325, current_value=0.14285714285714285, time used: 1058.555984735489\n",
      "Current var is [-1.         -0.9333486  -0.49220695  0.91663432 -0.83824497 -0.43382467\n",
      "  0.4706436   0.53881216 -0.45512891  0.03568464]\n",
      "step 390: T=0.6769247732130652, current_value=0.07142857142857142, time used: 1086.2080311775208\n",
      "Current var is [-0.91496134 -0.55600602 -0.53445237  0.32720638 -0.93847228  0.19418061\n",
      "  0.46802552  0.78399391  0.07688457  0.00259128]\n",
      "step 400: T=0.6701859060067401, current_value=0.07142857142857142, time used: 1114.2749662399292\n",
      "Current var is [-1.         -0.6003904  -0.34449966 -0.13498098 -0.93202652  0.29166994\n",
      "  0.61470329  0.59075547 -0.0296593  -0.15000284]\n",
      "step 410: T=0.6635141250307046, current_value=0.14285714285714285, time used: 1142.2272074222565\n",
      "Current var is [-0.37660513 -0.96393174 -0.70939816 -0.25932632 -0.49087635  0.688826\n",
      "  0.66457802  0.23335702  0.13867094 -0.15817652]\n",
      "step 420: T=0.6569087624334998, current_value=0.125, time used: 1170.2103343009949\n",
      "Current var is [-0.42907843 -0.94305062 -0.4201826  -0.78352709 -0.49280301  0.76772848\n",
      "  0.72949143  0.68400397  0.40995162  0.09294584]\n",
      "step 430: T=0.6503691570122083, current_value=0.17857142857142858, time used: 1197.8883419036865\n",
      "Current var is [-0.41095591 -0.76103028 -0.99334503 -0.80311244 -0.37170465  1.\n",
      "  0.4276303   0.47004876  0.37974126 -0.14606241]\n",
      "step 440: T=0.6438946541462667, current_value=0.125, time used: 1225.63414144516\n",
      "Current var is [-0.66198617 -0.86661774 -0.70510591 -1.         -0.66432344  1.\n",
      "  0.5076354   0.57545535  0.75675301 -0.10649605]\n",
      "step 450: T=0.6374846057319378, current_value=0.08928571428571429, time used: 1253.2512764930725\n",
      "Current var is [-0.53873347 -0.36567173 -0.77725494 -0.95267906 -0.87528563  1.\n",
      "  0.72667343  0.35620923  0.9600647   0.24939521]\n",
      "step 460: T=0.6311383701174349, current_value=0.14285714285714285, time used: 1280.0485746860504\n",
      "Current var is [-0.54338576 -0.25474995 -0.77992316 -0.85887829 -0.67881724  0.4954917\n",
      "  0.83763109 -0.0533064   0.66797118  0.00426242]\n",
      "step 470: T=0.6248553120386916, current_value=0.05357142857142857, time used: 1306.7292578220367\n",
      "Current var is [-0.88934017 -0.26518449 -1.         -1.         -0.76675901  0.67691701\n",
      "  0.93965112 -0.03935947  0.31000036  0.22368929]\n",
      "step 480: T=0.6186348025557713, current_value=0.125, time used: 1333.634262084961\n",
      "Current var is [-0.75861661  0.32134197 -0.67085749 -1.         -0.58013643  0.70414347\n",
      "  0.73897703  0.23647669 -0.19269611  0.3425473 ]\n",
      "step 490: T=0.6124762189899098, current_value=0.07142857142857142, time used: 1360.7946846485138\n",
      "Current var is [-0.51055286 -0.05019247 -0.46836273 -0.82797466 -0.49000504  0.68986751\n",
      "  0.14264509 -0.1063934  -0.42885725  0.39480362]\n",
      "step 500: T=0.6063789448611847, current_value=0.05357142857142857, time used: 1387.870272397995\n",
      "Current var is [-0.84970836  0.40992435 -0.11218827 -0.42768539 -0.26401228  0.27286433\n",
      "  0.31255348  0.08016475 -0.21252163  1.        ]\n",
      "step 510: T=0.6003423698268051, current_value=0.10714285714285714, time used: 1415.7576885223389\n",
      "Current var is [-0.97882959 -0.18262849 -0.00497443  0.20042882 -0.38190098  0.78396694\n",
      "  0.78182396  0.54226659  0.23367454  0.55890161]\n",
      "step 520: T=0.5943658896200157, current_value=0.08928571428571429, time used: 1443.4027802944183\n",
      "Current var is [-0.99922873 -0.17760846  0.00807276  0.45236817  0.4326821   0.58667817\n",
      "  1.          0.23594361  0.30769802  0.38604989]\n",
      "step 530: T=0.5884489059896089, current_value=0.10714285714285714, time used: 1471.0757429599762\n",
      "Current var is [-5.94722784e-01  3.71293742e-05  2.53392185e-01  7.66308925e-02\n",
      "  5.33418483e-01  3.37653679e-01  6.65066285e-01  7.27367945e-01\n",
      " -4.08115182e-02  4.87042217e-01]\n",
      "step 540: T=0.5825908266400397, current_value=0.125, time used: 1497.6337418556213\n",
      "Current var is [0.32380973 0.3231623  0.35864567 0.49311721 0.61255031 0.0803918\n",
      " 0.13543779 0.88504526 0.37331307 0.52081647]\n",
      "step 550: T=0.5767910651721362, current_value=0.14285714285714285, time used: 1524.8668808937073\n",
      "Current var is [ 0.37222012  0.51801287  0.73211522  0.44008179  0.27061481 -0.05847134\n",
      " -0.01242897  0.78360103  0.60013108  0.15546038]\n",
      "step 560: T=0.5710490410244007, current_value=0.08928571428571429, time used: 1551.8527071475983\n",
      "Current var is [ 0.24289223  0.3423974   0.5155485  -0.04653076  0.40401247 -0.31327991\n",
      "  0.27205156  0.78527297  0.76114943  0.33636872]\n",
      "step 570: T=0.5653641794148944, current_value=0.07142857142857142, time used: 1578.9861681461334\n",
      "Current var is [-0.13657702  0.54375578  0.63684218 -0.37814343  0.30018368 -0.33461726\n",
      "  0.07262678  0.71213385  0.49884076 -0.02610064]\n",
      "step 580: T=0.5597359112837017, current_value=0.125, time used: 1605.890187740326\n",
      "Current var is [ 0.34359101  0.67895548  0.86019158 -0.32618329  0.16305183 -0.26666686\n",
      " -0.08124007  0.99568353  0.6433726   0.56762642]\n",
      "step 590: T=0.5541636732359667, current_value=0.125, time used: 1632.1569654941559\n",
      "Current var is [ 0.40127562  0.87205928  0.48077467 -0.49982779  0.00789556 -0.42677122\n",
      "  0.05615729  0.92379996  0.40701639  0.918011  ]\n",
      "step 600: T=0.5486469074854967, current_value=0.125, time used: 1657.9359922409058\n",
      "Current var is [ 0.37745958  0.85832512  0.56301225 -0.77622822 -0.20561875 -0.93138112\n",
      " -0.10914623  0.75798342  0.32791579  0.90509293]\n",
      "step 610: T=0.5431850617989273, current_value=0.07142857142857142, time used: 1683.8077991008759\n",
      "Current var is [-0.13139443  0.36336928  0.9666314  -1.         -0.25639109 -0.914827\n",
      " -0.18424615  1.          0.78190887  1.        ]\n",
      "step 620: T=0.5377775894404437, current_value=0.17857142857142858, time used: 1709.517068862915\n",
      "Current var is [-0.07319799  0.63076237  1.         -0.72419903 -0.23730871 -0.84060202\n",
      "  0.23815544  0.25141792  0.97639477  0.86228703]\n",
      "step 630: T=0.5324239491170513, current_value=0.125, time used: 1735.2053389549255\n",
      "Current var is [-0.33598463  0.22703024  0.4495826  -0.59380449 -0.15163876 -0.89147668\n",
      "  0.19052202 -0.20682121  0.08164948  0.96142897]\n",
      "step 640: T=0.527123604924392, current_value=0.14285714285714285, time used: 1761.187851190567\n",
      "Current var is [-0.32707189  0.58923202  0.27106364 -0.82295624 -0.28412054 -0.8698542\n",
      "  0.19695183 -0.10530126 -0.06729871  0.73073921]\n",
      "step 650: T=0.5218760262931004, current_value=0.10714285714285714, time used: 1787.4027407169342\n",
      "Current var is [-0.13639184  0.40734786  0.14195185 -0.86331436  0.19719786 -0.75251326\n",
      " -0.11982408  0.0760125  -0.00735564  0.80170392]\n",
      "step 660: T=0.516680687935692, current_value=0.14285714285714285, time used: 1813.580727338791\n",
      "Current var is [-0.35796695  0.18490688  0.62873573 -0.66427031  0.21442953 -0.67124036\n",
      " -0.40421587 -0.09404231 -0.16177252  0.69651987]\n",
      "step 670: T=0.5115370697939825, current_value=0.05357142857142857, time used: 1839.8833837509155\n",
      "Current var is [-0.33749673  0.23109063  0.37711884 -1.         -0.26633703 -1.\n",
      " -0.85596507 -0.02270775 -0.02429438  0.78056847]\n",
      "step 680: T=0.506444656987029, current_value=0.08928571428571429, time used: 1865.7292876243591\n",
      "Current var is [-0.19149098 -0.34058084 -0.2824195  -0.45110295  0.18590153 -0.73838847\n",
      "  0.05774329 -0.49281343  0.02773709  0.99789835]\n",
      "step 690: T=0.50140293975959, current_value=0.08928571428571429, time used: 1891.7456803321838\n",
      "Current var is [-0.10458201 -0.28716949  0.15216479 -0.26286715 -0.19078798 -1.\n",
      "  0.47321524 -0.45743649 -0.26272069  0.96192644]\n",
      "step 700: T=0.49641141343109896, current_value=0.125, time used: 1917.772085905075\n",
      "Current var is [-0.30356061 -0.5283328   0.45392381 -0.11592114 -0.90766374 -0.87663522\n",
      "  0.06941178 -0.78204012 -0.04720276  0.62347923]\n",
      "step 710: T=0.49146957834514415, current_value=0.14285714285714285, time used: 1943.4932820796967\n",
      "Current var is [-0.45491704 -0.80468885  0.51302427  0.2753636  -0.40342428 -0.81393677\n",
      "  0.24588515 -0.89121135  0.19643386  0.79473799]\n",
      "step 720: T=0.4865769398194537, current_value=0.125, time used: 1969.34015583992\n",
      "Current var is [-0.41764224 -0.75708033  0.42685054  0.4514541  -0.71417684 -1.\n",
      "  0.7144924  -0.79634084  0.27080547  1.        ]\n",
      "step 730: T=0.4817330080963769, current_value=0.125, time used: 1995.1900227069855\n",
      "Current var is [-0.64210305 -0.68543733  0.55741017  0.52339045 -0.83383916 -0.99897569\n",
      "  0.30587303 -0.96471453 -0.12702035  0.87392741]\n",
      "step 740: T=0.47693729829385917, current_value=0.07142857142857142, time used: 2021.0977339744568\n",
      "Current var is [-0.91340659 -0.9320549   0.27047662  0.15908575 -0.92054258 -1.\n",
      "  0.64231835 -1.         -0.12736157  0.76745321]\n",
      "step 750: T=0.47218933035690475, current_value=0.10714285714285714, time used: 2046.868810415268\n",
      "Current var is [-0.71335082 -0.53415029 -0.06352619 -0.10733461 -0.78903883 -0.91950226\n",
      "  0.12504095 -0.97366069 -0.03414684  0.48942217]\n",
      "step 760: T=0.467488629009523, current_value=0.05357142857142857, time used: 2072.5361626148224\n",
      "Current var is [-0.63453984 -0.47702274  0.10538429 -0.5045961  -0.50325758 -1.\n",
      " -0.10739292 -0.76188909  0.52756655  0.91120361]\n",
      "step 770: T=0.46283472370715256, current_value=0.07142857142857142, time used: 2098.2673473358154\n",
      "Current var is [-0.67500584 -0.78359249 -0.37362011 -0.83777794 -0.28347851 -1.\n",
      "  0.22763844 -0.72042631  1.          0.91050373]\n",
      "step 780: T=0.45822714858955976, current_value=0.17857142857142858, time used: 2123.952653169632\n",
      "Current var is [-0.85199753 -0.8016675  -0.03123499 -0.98063988 -0.23311169 -0.82638654\n",
      " -0.09858712 -0.90088233  0.49633068  0.90054591]\n",
      "step 790: T=0.4536654424342052, current_value=0.08928571428571429, time used: 2149.6569068431854\n",
      "Current var is [-0.92891613 -0.1473403   0.05932604 -0.48644376 -0.04581644 -1.\n",
      "  0.04207305 -0.67892018  0.35765035  0.50110091]\n",
      "step 800: T=0.4491491486100751, current_value=0.07142857142857142, time used: 2175.3721339702606\n",
      "Current var is [-0.98963545 -0.27515828  0.10101987 -0.17440011 -0.36069121 -1.\n",
      "  0.82723497 -0.34719477  0.83166899  0.69084365]\n",
      "step 810: T=0.4446778150319722, current_value=0.08928571428571429, time used: 2201.192079782486\n",
      "Current var is [-0.77244238 -0.08498824 -0.3572487  -0.4851024   0.24480563 -1.\n",
      "  0.57986372 -0.84050993  0.93359328  0.54137698]\n",
      "step 820: T=0.4402509941152615, current_value=0.08928571428571429, time used: 2227.062916278839\n",
      "Current var is [-0.93775069  0.1172747  -0.35829667 -0.21955033  0.20799703 -0.33463136\n",
      "  0.7201405  -0.85925998  0.80008685  0.97624958]\n",
      "step 830: T=0.4358682427310666, current_value=0.10714285714285714, time used: 2252.97771024704\n",
      "Current var is [-0.77722534  0.12750777 -1.         -0.56239687  0.14255859 -0.38986691\n",
      "  0.63345478 -0.5736038   0.77165227  0.90497895]\n",
      "step 840: T=0.4315291221619123, current_value=0.07142857142857142, time used: 2279.0699355602264\n",
      "Current var is [-0.68430376  0.82546082 -0.7998449  -0.77558281  0.20820151 -0.22929781\n",
      "  0.7624865  -1.          0.72562361  0.77114605]\n",
      "step 850: T=0.42723319805780824, current_value=0.07142857142857142, time used: 2305.216968536377\n",
      "Current var is [-0.51819737  0.39397813 -0.93384525 -0.74262894  0.33110055 -0.10333687\n",
      "  0.70247358 -0.62239364  0.54851514  0.76000751]\n",
      "step 860: T=0.42298004039277043, current_value=0.125, time used: 2331.911605358124\n",
      "Current var is [-0.42561565  0.36310604 -0.76110515 -0.85915576  0.62584749  0.37961061\n",
      "  0.5181324  -0.42187866 -0.07960145  0.67453764]\n",
      "step 870: T=0.41876922342177486, current_value=0.08928571428571429, time used: 2360.127144098282\n",
      "Current var is [-0.44764103  0.37685598  0.11017746 -0.88087915  0.35770148  0.62723609\n",
      "  0.5981809  -0.87330034 -0.05372862  0.56548779]\n",
      "step 880: T=0.41460032563814037, current_value=0.10714285714285714, time used: 2388.640855073929\n",
      "Current var is [-0.48796629  0.54759153 -0.17291309 -0.34552439  0.44817335  0.55113865\n",
      "  1.         -0.91454297  0.33312751  0.08671933]\n",
      "step 890: T=0.41047292973133526, current_value=0.14285714285714285, time used: 2417.324179172516\n",
      "Current var is [-0.40865267 -0.32308288  0.40344209 -0.40927146  0.33890944  1.\n",
      "  0.79519367 -0.56660504  0.31642109 -0.44174493]\n",
      "step 900: T=0.4063866225452042, current_value=0.08928571428571429, time used: 2446.0144412517548\n",
      "Current var is [-0.46302749 -0.91035749  0.87992735 -0.51302923  0.30247227  0.70131818\n",
      "  0.43166122 -0.79188763  0.25548351 -0.57395579]\n",
      "step 910: T=0.40234099503661086, current_value=0.07142857142857142, time used: 2474.3686139583588\n",
      "Current var is [-0.57486258 -0.70461671  1.         -0.76443453  0.23093283  0.73098275\n",
      "  0.61732176 -0.7347016   0.1502925  -0.50966509]\n",
      "step 920: T=0.3983356422344923, current_value=0.05357142857142857, time used: 2504.0437660217285\n",
      "Current var is [-0.4165416  -0.73023903  0.45448362 -0.68269982  0.3343055   1.\n",
      "  0.28523203 -0.25036202 -0.57464065 -0.34560945]\n",
      "step 930: T=0.39437016319932106, current_value=0.125, time used: 2533.4691894054413\n",
      "Current var is [-0.22297834 -0.44407468  0.68379062 -1.          0.2322426   0.966542\n",
      "  0.12210982  0.06043441 -0.30632087 -0.88559987]\n",
      "step 940: T=0.39044416098297063, current_value=0.07142857142857142, time used: 2562.2611865997314\n",
      "Current var is [-0.76887204 -0.42978188  0.64651092 -0.82383719 -0.27486202  0.87290852\n",
      "  0.20518704  0.30875071 -0.26382564 -0.88095459]\n",
      "step 950: T=0.38655724258898083, current_value=0.125, time used: 2591.128981113434\n",
      "Current var is [-0.68262449 -1.          1.         -0.96622513 -0.29703271  0.93654439\n",
      "  0.14280103  0.07335565 -0.18650691 -0.48216143]\n",
      "step 960: T=0.38270901893321807, current_value=0.07142857142857142, time used: 2619.893080472946\n",
      "Current var is [-0.67179311 -0.87645737  0.44913457 -0.95443763  0.03991094  0.64749509\n",
      "  0.0382747  -0.15830413 -0.3964425  -0.24012313]\n",
      "step 970: T=0.37889910480492817, current_value=0.07142857142857142, time used: 2648.7878019809723\n",
      "Current var is [-0.52732611 -0.72740165  0.32120425 -0.90812346  0.39022488  0.90904866\n",
      "  0.51795279 -0.54661026 -0.47469101 -0.40078879]\n",
      "step 980: T=0.3751271188281759, current_value=0.125, time used: 2677.825145959854\n",
      "Current var is [-0.01019741 -0.78667854 -0.16536639 -0.63216106  0.86117032  0.89205308\n",
      " -0.14887358 -0.95803797 -0.59889781 -0.27149858]\n",
      "step 990: T=0.37139268342366943, current_value=0.125, time used: 2705.830216407776\n",
      "Current var is [-0.0212025  -0.63666852  0.22967566 -0.58585075  1.          1.\n",
      " -1.         -1.         -0.83387668 -0.22025703]\n",
      "step 1000: T=0.36769542477096373, current_value=0.08928571428571429, time used: 2734.0268342494965\n",
      "Current var is [-0.11874977 -0.36801451 -0.23799384 -0.48696943  0.78345498  0.86765607\n",
      " -0.85935781 -0.77729354 -0.9845383  -0.41933389]\n",
      "step 1010: T=0.36403497277104124, current_value=0.03571428571428571, time used: 2762.431838274002\n",
      "Current var is [-0.76091192 -0.56229833 -0.12264699 -0.31944064  0.53528842  0.85933867\n",
      " -0.9444039  -0.85890726 -0.94008532  0.09142814]\n",
      "step 1020: T=0.3604109610092645, current_value=0.05357142857142857, time used: 2790.5506687164307\n",
      "Current var is [-0.91703763 -0.67633753 -0.27956189 -0.12638679  0.99591518  0.92331808\n",
      " -0.37716153 -0.59195868 -0.75170155 -0.1922172 ]\n",
      "step 1030: T=0.3568230267186975, current_value=0.08928571428571429, time used: 2819.2000420093536\n",
      "Current var is [-1.         -0.50393315 -0.13321911 -0.7047151   0.783876    1.\n",
      " -0.92321106 -0.64327609 -0.59755713  0.01672408]\n",
      "step 1040: T=0.35327081074379263, current_value=0.125, time used: 2847.8593673706055\n",
      "Current var is [-0.3314998  -0.3788329   0.27353508 -0.77828066  0.84321772  0.76884184\n",
      " -0.24329252 -0.43639022 -0.29945685  0.0686292 ]\n",
      "step 1050: T=0.34975395750443883, current_value=0.07142857142857142, time used: 2876.375129699707\n",
      "Current var is [-0.51940732 -0.49714536  0.52497692 -0.24680479  0.7651057   0.77054895\n",
      " -0.79770101 -0.95080668 -0.56415596  0.76963657]\n",
      "step 1060: T=0.34627211496036747, current_value=0.03571428571428571, time used: 2904.3233840465546\n",
      "Current var is [-1.         -0.15045978  0.57067123 -0.25594739  0.36706659  0.45049106\n",
      " -0.42824889 -0.82100603 -0.25014371  0.99204315]\n",
      "step 1070: T=0.3428249345759132, current_value=0.07142857142857142, time used: 2932.0821158885956\n",
      "Current var is [-0.77975591 -0.23080329  0.61996213 -0.26308011  0.83136943  0.13980764\n",
      " -1.         -1.         -0.38737727  0.29446268]\n",
      "step 1080: T=0.33941207128512474, current_value=0.16071428571428573, time used: 2960.048349380493\n",
      "Current var is [-0.65266901  0.17223563  0.80714704 -0.36308119  0.4552675   0.19108113\n",
      " -1.         -0.42786414 -0.44252229  0.5717234 ]\n",
      "step 1090: T=0.3360331834572238, current_value=0.17857142857142858, time used: 2987.7462725639343\n",
      "Current var is [-0.71003274  0.74950647  0.32141004 -0.49595649  0.16640376  0.29991638\n",
      " -0.57114448 -0.06893756 -0.5744435   0.4273964 ]\n",
      "step 1100: T=0.3326879328624075, current_value=0.10714285714285714, time used: 3015.725415468216\n",
      "Current var is [-0.96406547  0.66283264  0.03287131 -0.04874123  0.1253387   0.30412591\n",
      " -0.60767882 -0.31241795 -0.33149133  0.51897625]\n",
      "step 1110: T=0.329375984637991, current_value=0.07142857142857142, time used: 3043.504124403\n",
      "Current var is [-0.88705778  0.62161934 -0.44093944 -0.08822023  0.34827402  0.4287384\n",
      " -1.          0.42585471 -0.27259635 -0.12393052]\n",
      "step 1120: T=0.32609700725488766, current_value=0.125, time used: 3071.5092532634735\n",
      "Current var is [-0.61694721  0.74187505 -0.77778178  0.29866612  0.65517724  0.34209952\n",
      " -1.          0.74944786 -0.4276355  -0.44900848]\n",
      "step 1130: T=0.3228506724844226, current_value=0.14285714285714285, time used: 3099.5662150382996\n",
      "Current var is [-0.24886329  0.89035392 -0.37784961  0.21086911  0.18541731  0.20328167\n",
      " -0.94344844  1.         -0.10838656 -0.75627097]\n",
      "step 1140: T=0.31963665536547686, current_value=0.16071428571428573, time used: 3127.7747445106506\n",
      "Current var is [-0.05563165  0.71917587 -0.40001569  0.0116513   0.55801704 -0.36756403\n",
      " -0.70099685  1.          0.20202735 -1.        ]\n",
      "step 1150: T=0.3164546341719581, current_value=0.03571428571428571, time used: 3156.3184061050415\n",
      "Current var is [-0.5795731   1.          0.16002546 -0.20827132  0.94770001 -0.29211352\n",
      " -0.92340371  0.66420466  0.71388765 -0.7244159 ]\n",
      "step 1160: T=0.313304290380596, current_value=0.10714285714285714, time used: 3184.8720684051514\n",
      "Current var is [-0.44584174  1.          0.43350517 -0.10416593  0.97135305 -0.54685256\n",
      " -0.78241245  0.91373637  1.         -1.        ]\n",
      "step 1170: T=0.3101853086390573, current_value=0.08928571428571429, time used: 3213.478596687317\n",
      "Current var is [-0.50851491  0.92522881  0.51735628 -0.05633233  1.         -0.27021196\n",
      " -0.31219401  0.65744297  1.         -0.71203397]\n",
      "step 1180: T=0.30709737673437926, current_value=0.125, time used: 3242.209783554077\n",
      "Current var is [-0.43890662  0.72489274  0.9424109  -0.17077756  0.89741239 -0.68248041\n",
      " -0.19117044  0.97745978  1.         -0.8440791 ]\n",
      "step 1190: T=0.3040401855617164, current_value=0.08928571428571429, time used: 3270.9199709892273\n",
      "Current var is [-0.60497241  0.58005226  0.26022952 -0.15787259  0.74688746 -0.27783949\n",
      " -0.45996885  1.          1.         -1.        ]\n",
      "step 1200: T=0.3010134290933991, current_value=0.125, time used: 3300.147691965103\n",
      "Current var is [-0.59036993  0.42328686  0.55348729 -0.00325327  1.         -0.19476282\n",
      " -0.23203273  0.80072974  1.         -0.7185194 ]\n",
      "step 1210: T=0.2980168043482999, current_value=0.14285714285714285, time used: 3329.319701910019\n",
      "Current var is [-0.94616863  0.5695618   0.29784096  0.49393408  0.96328552  0.22158216\n",
      " -0.37822672  0.26135128  0.66608531 -0.93947433]\n",
      "step 1220: T=0.29505001136150455, current_value=0.07142857142857142, time used: 3358.327094554901\n",
      "Current var is [-0.82768906 -0.11517814  0.37021712  0.59354875  1.          0.17308973\n",
      " -0.37958104  0.21875234  0.41929817 -0.87022585]\n",
      "step 1230: T=0.2921127531542856, current_value=0.07142857142857142, time used: 3387.4352746009827\n",
      "Current var is [-0.24976836  0.18011079 -0.60528494  0.04549596  0.87870559 -0.06096609\n",
      " -0.46465992  0.06709385  0.20220529 -0.7437826 ]\n",
      "step 1240: T=0.28920473570437444, current_value=0.10714285714285714, time used: 3416.298082113266\n",
      "Current var is [ 0.00582865  0.65391061 -0.86349197  0.57902846  0.71900445  0.26156573\n",
      " -0.56952111  0.33857438  0.36838088 -0.70480881]\n",
      "step 1250: T=0.28632566791652925, current_value=0.125, time used: 3445.058163881302\n",
      "Current var is [-0.45154296  1.         -0.91883361  0.17019918  0.80065741  0.09320612\n",
      " -0.90611951  0.17816736 -0.21380491 -0.62114394]\n",
      "step 1260: T=0.28347526159339637, current_value=0.14285714285714285, time used: 3473.020352125168\n",
      "Current var is [-0.70011533  0.97574614 -0.75452488  0.25747901  0.60105471 -0.18685121\n",
      " -1.          0.18599106 -0.7260254  -0.86262163]\n",
      "step 1270: T=0.28065323140666115, current_value=0.05357142857142857, time used: 3501.3446006774902\n",
      "Current var is [-1.          0.35073237 -0.67717726  0.58319792  0.63068746  0.14618836\n",
      " -1.          0.18036115 -0.94775118 -0.87053794]\n",
      "step 1280: T=0.2778592948684866, current_value=0.08928571428571429, time used: 3529.298866033554\n",
      "Current var is [-0.7579758   0.28713405 -0.46439455  0.92702408  0.24975153  0.58217568\n",
      " -1.          0.10230036 -0.81804192 -0.67826812]\n",
      "step 1290: T=0.2750931723032359, current_value=0.08928571428571429, time used: 3557.0835568904877\n",
      "Current var is [-0.74304506  0.36738862 -0.5814877   0.91547269  0.04124272  0.63848184\n",
      " -0.96122703 -0.07053227 -0.76763184 -0.98164383]\n",
      "step 1300: T=0.2723545868194768, current_value=0.10714285714285714, time used: 3585.175426721573\n",
      "Current var is [-1.         -0.17062678 -0.73761677  0.9540605   0.2736552   0.49491642\n",
      " -1.          0.27227298 -0.81270589 -0.71166474]\n",
      "step 1310: T=0.26964326428226437, current_value=0.10714285714285714, time used: 3613.2732808589935\n",
      "Current var is [-0.85859705 -0.98107107 -0.71112249  0.90400985  0.71775356  0.47303842\n",
      " -0.92905466  0.62849895 -0.46157377 -0.69335031]\n",
      "step 1320: T=0.2669589332856999, current_value=0.03571428571428571, time used: 3641.4579095840454\n",
      "Current var is [-0.83578499 -0.6902169  -0.71375188  0.81565739  0.68695962  1.\n",
      " -0.14093491  0.48730015 -0.30569592 -0.35303649]\n",
      "step 1330: T=0.26430132512576293, current_value=0.10714285714285714, time used: 3670.1900680065155\n",
      "Current var is [-0.990295   -0.97635242 -0.75730431  1.          0.62542458  0.6921138\n",
      " -0.14773519  0.28431179 -0.394894   -0.77319582]\n",
      "step 1340: T=0.2616701737734137, current_value=0.08928571428571429, time used: 3698.819498538971\n",
      "Current var is [-0.57550416 -0.94664823 -1.          0.89466489  0.19412454  0.75421777\n",
      " -0.06672013  0.36020282 -0.76284024 -1.        ]\n",
      "step 1350: T=0.2590652158479633, current_value=0.125, time used: 3726.7701914310455\n",
      "Current var is [-0.38071287 -1.         -1.          0.98334996  0.25780763  0.15800155\n",
      " -0.25752002 -0.00287938 -0.55168246 -0.10697118]\n",
      "step 1360: T=0.25648619059070943, current_value=0.10714285714285714, time used: 3754.2956607341766\n",
      "Current var is [-0.60112482 -0.73368342 -0.53135863  0.77722521  0.38182759  0.44945407\n",
      "  0.07562204  0.02223675 -0.92811615  0.3510236 ]\n",
      "step 1370: T=0.2539328398388336, current_value=0.10714285714285714, time used: 3782.2538545131683\n",
      "Current var is [-0.40955148 -0.66378112 -0.60843345  0.65895899  0.32166941  0.55496259\n",
      " -0.02443981  0.33280274 -0.77752691  0.27157773]\n",
      "step 1380: T=0.25140490799955917, current_value=0.05357142857142857, time used: 3810.042633295059\n",
      "Current var is [-0.41302312 -0.9781147  -1.          0.91755832  0.96803218  0.36263293\n",
      "  0.16210369  0.02502144 -0.17220388  0.89617558]\n",
      "step 1390: T=0.2489021420245663, current_value=0.10714285714285714, time used: 3836.6335184574127\n",
      "Current var is [-0.08282854 -0.89830947 -0.76183565  0.99083013  0.91358131  0.10870822\n",
      "  0.44487075  0.44237294  0.07517555  0.64319042]\n",
      "step 1400: T=0.2464242913846615, current_value=0.07142857142857142, time used: 3863.7449679374695\n",
      "Current var is [-0.00979323 -0.72627085 -0.74516591  0.64205591  0.71578069  0.35215082\n",
      "  0.25835435  0.07824046 -0.43978091  0.10601855]\n",
      "step 1410: T=0.24397110804469926, current_value=0.07142857142857142, time used: 3892.1470432281494\n",
      "Current var is [ 0.11122886 -0.84307958 -0.78519872  0.4799724   0.96623362  0.75921759\n",
      "  0.2810755  -0.04261854 -0.56819841 -0.0054075 ]\n",
      "step 1420: T=0.2415423464387538, current_value=0.07142857142857142, time used: 3920.434354543686\n",
      "Current var is [-0.00577049 -0.21450264 -0.85151526 -0.02619364  0.52810714  0.67799269\n",
      "  0.09092664  0.1774394  -1.         -0.3884801 ]\n",
      "step 1430: T=0.23913776344553753, current_value=0.16071428571428573, time used: 3948.8832693099976\n",
      "Current var is [ 0.33611614  0.36718729 -1.         -0.15821089  1.          0.60584584\n",
      "  0.82679826  0.2794114  -0.75032139 -0.67519738]\n",
      "step 1440: T=0.2367571183640643, current_value=0.125, time used: 3977.804953813553\n",
      "Current var is [-0.10514468  0.31713834 -0.66579958 -0.02298264  0.92783633  0.64696095\n",
      "  0.6801027   0.5844988  -0.53594492 -0.72535569]\n",
      "step 1450: T=0.2344001728895552, current_value=0.14285714285714285, time used: 4006.140173435211\n",
      "Current var is [-0.33363004  0.3869396  -0.68642381  0.13072082  0.78917868  0.68302345\n",
      "  0.46126788  0.44461819 -0.67762933 -0.90520937]\n",
      "step 1460: T=0.23206669108958394, current_value=0.07142857142857142, time used: 4034.678853750229\n",
      "Current var is [-0.82664683  0.40324673 -0.92044082  0.55345748  0.80999594  1.\n",
      "  0.52146367  0.98711409 -0.29306613 -0.82352993]\n",
      "step 1470: T=0.22975643938045978, current_value=0.07142857142857142, time used: 4063.3212456703186\n",
      "Current var is [-0.61996393  0.78601984 -0.41938668  0.07181932  0.93633404  0.59478195\n",
      "  0.51181072  0.53103143  0.00476799 -1.        ]\n",
      "step 1480: T=0.2274691865038456, current_value=0.17857142857142858, time used: 4092.159125804901\n",
      "Current var is [-0.62865435  1.         -0.57755704  0.70046239  0.89107504  0.96391277\n",
      "  0.63603416  0.40401499  0.02418547 -0.9656421 ]\n",
      "step 1490: T=0.22520470350360866, current_value=0.08928571428571429, time used: 4121.130635499954\n",
      "Current var is [-1.          0.7097176  -0.91198971  0.69835043  0.87326824  0.83081128\n",
      "  0.86110441  0.99463046  0.69511598 -0.91117777]\n",
      "step 1500: T=0.2229627637029021, current_value=0.05357142857142857, time used: 4149.6902551651\n",
      "Current var is [-0.55713617  0.21900125 -1.          0.84782737  0.35286518  0.73672525\n",
      "  0.55441739  0.84341387  0.89285798 -0.87639173]\n",
      "step 1510: T=0.2207431426814741, current_value=0.08928571428571429, time used: 4177.692329883575\n",
      "Current var is [-0.89155361  0.28041986 -0.87715757  0.80573002  0.18441951  0.93131897\n",
      "  0.17822066  0.98350787  0.92009384 -0.9184257 ]\n",
      "step 1520: T=0.2185456182532034, current_value=0.10714285714285714, time used: 4205.879944562912\n",
      "Current var is [-0.75694182  0.39246225 -0.96069552  0.82933129 -0.2638304   0.85090929\n",
      " -0.25750249  0.91242178  0.97093544 -1.        ]\n",
      "step 1530: T=0.2163699704438581, current_value=0.07142857142857142, time used: 4233.713505268097\n",
      "Current var is [-0.58591406  0.81618563 -0.87908792  0.7914681  -0.12753897  0.84366846\n",
      "  0.13959097  0.78722863  0.95630811 -0.84008642]\n",
      "step 1540: T=0.21421598146907628, current_value=0.08928571428571429, time used: 4261.739583969116\n",
      "Current var is [-0.55851993  0.99514111 -0.90638145  0.41145798 -0.19133819  0.6820498\n",
      " -0.78576762  0.88869707  0.58389477 -0.99847203]\n",
      "step 1550: T=0.21208343571256524, current_value=0.08928571428571429, time used: 4289.728693723679\n",
      "Current var is [-0.60339557  0.9485296  -0.91664737  0.82114781 -0.64778231  0.70171144\n",
      " -0.76677278  0.52605818  0.39737286 -0.62080875]\n",
      "step 1560: T=0.20997211970451848, current_value=0.10714285714285714, time used: 4317.528381109238\n",
      "Current var is [-0.59639473  0.73502809 -0.99992139  0.69031738 -0.92955845  0.69759629\n",
      " -0.36959915  0.62941945  0.61437221 -0.55345756]\n",
      "step 1570: T=0.20788182210024692, current_value=0.017857142857142856, time used: 4345.152531147003\n",
      "Current var is [-0.8212357   0.22385796 -0.91264865  0.49358693 -0.71970076  0.46684882\n",
      " -0.10703608  0.87446765  0.88166815 -0.13304247]\n",
      "step 1580: T=0.20581233365902316, current_value=0.017857142857142856, time used: 4372.091483592987\n",
      "Current var is [-0.55774474  0.06453149 -0.72959781  0.13450952 -0.6359876   0.01019074\n",
      " -0.30303462  0.68181856  0.83751983 -0.34028193]\n",
      "step 1590: T=0.2037634472231363, current_value=0.07142857142857142, time used: 4399.228878974915\n",
      "Current var is [-0.34865979  0.29653897 -0.82237133  0.02934648 -0.99190704 -0.05373379\n",
      "  0.14472941  0.68501931  0.70070597 -0.32936509]\n",
      "step 1600: T=0.20173495769715533, current_value=0.125, time used: 4426.310449361801\n",
      "Current var is [-0.52940122  0.05535469 -0.78445336 -0.18231173 -0.17128001 -0.55970967\n",
      " -0.21356946  0.45857335  0.70564467 -0.00750153]\n",
      "step 1610: T=0.19972666202739878, current_value=0.0, time used: 4453.021045684814\n",
      "Current var is [-0.59626366  0.36754567 -0.86523745 -0.40319512 -0.21102434 -0.92333494\n",
      " -0.21968089  0.23565648  0.32591354 -0.00261602]\n",
      "step 1620: T=0.19773835918160887, current_value=0.08928571428571429, time used: 4478.745239019394\n",
      "Current var is [-0.83526723  0.36117552 -0.61468795 -0.31039693 -1.         -0.55770653\n",
      " -0.38630265  0.45987331  0.58789696  0.42701793]\n",
      "step 1630: T=0.19576985012882814, current_value=0.10714285714285714, time used: 4504.30887389183\n",
      "Current var is [-1.          0.08812006 -0.49847003  0.32335635 -1.         -0.6034183\n",
      " -0.44403862 -0.00361421  0.95387867  0.76483947]\n",
      "step 1640: T=0.193820937819476, current_value=0.03571428571428571, time used: 4529.951341629028\n",
      "Current var is [-0.55715151  0.21408246 -0.45202357  0.21161057 -0.71394857 -0.74827927\n",
      "  0.05816648 -0.36336351  0.90713834  0.87258878]\n",
      "step 1650: T=0.19189142716562418, current_value=0.125, time used: 4555.706424951553\n",
      "Current var is [-0.59045897  0.13104766 -0.73944973  0.61085014 -0.91016023 -0.59959688\n",
      " -0.14307781 -0.40479953  1.          1.        ]\n",
      "step 1660: T=0.189981125021468, current_value=0.05357142857142857, time used: 4581.1244831085205\n",
      "Current var is [-0.61361868  0.15970263 -0.5750426   0.52914619 -0.53463223 -0.6206752\n",
      " -0.14149307 -0.13290269  0.78071861  0.80897353]\n",
      "step 1670: T=0.1880898401639925, current_value=0.08928571428571429, time used: 4606.896553516388\n",
      "Current var is [-0.5868507  -0.36574771 -0.66426243  0.46896478 -0.28026269  0.15843099\n",
      " -0.57361138  0.40673049  0.46079807  0.86262222]\n",
      "step 1680: T=0.18621738327383064, current_value=0.017857142857142856, time used: 4632.5499448776245\n",
      "Current var is [-0.98108294 -0.24071029 -0.89239405  0.06116794  0.00820157  0.35923582\n",
      "  0.19266769  0.70746292  0.21228818  0.89390633]\n",
      "step 1690: T=0.18436356691631242, current_value=0.10714285714285714, time used: 4658.193365812302\n",
      "Current var is [-0.73433632 -0.19473412 -0.54197743  0.46911831  0.60803713 -0.11292868\n",
      " -0.11673316  0.86729662 -0.16041696  1.        ]\n",
      "step 1700: T=0.18252820552270244, current_value=0.125, time used: 4684.935841321945\n",
      "Current var is [-0.86416282  0.17875626 -0.84012221  0.89453401  0.19869221  0.05130039\n",
      " -0.0573164   0.82621273 -0.19738439  0.72640383]\n",
      "step 1710: T=0.1807111153716242, current_value=0.14285714285714285, time used: 4711.868803501129\n",
      "Current var is [-0.59606605 -0.09779668 -0.81691754  0.91695694 -0.00373583  0.08717648\n",
      " -0.31753353  0.67328796 -0.73303267  0.54590682]\n",
      "step 1720: T=0.1789121145706697, current_value=0.07142857142857142, time used: 4739.137883424759\n",
      "Current var is [-0.93961251 -0.25106016 -0.51533708  0.91301726 -0.1146255   0.26442654\n",
      " -0.37116868  0.43169339 -0.72189353  0.24079909]\n",
      "step 1730: T=0.17713102303819142, current_value=0.07142857142857142, time used: 4766.6452786922455\n",
      "Current var is [-0.70053487 -0.39283129 -0.58011212  0.50367256 -0.28265477  0.74139925\n",
      " -0.71201459  0.62505589 -0.49210045  0.13893477]\n",
      "step 1740: T=0.17536766248527638, current_value=0.14285714285714285, time used: 4793.088593244553\n",
      "Current var is [-0.72150153 -0.4036245  -0.26783109  0.42335779 -0.61351833  0.831413\n",
      " -0.93961001  0.40558486 -0.65688549  0.60671412]\n",
      "step 1750: T=0.173621856397899, current_value=0.125, time used: 4819.403208017349\n",
      "Current var is [-0.70165421 -0.82512165 -0.41572306  0.31160148 -0.51471322  0.42825001\n",
      " -0.99711531  0.86846776 -0.51160579  0.86175423]\n",
      "step 1760: T=0.171893430019252, current_value=0.07142857142857142, time used: 4845.377713441849\n",
      "Current var is [-0.77632853 -0.42762958 -0.29980289  0.20511088 -0.58078022  0.97853914\n",
      " -1.          0.52913157 -0.32326352  0.7755912 ]\n",
      "step 1770: T=0.1701822103322531, current_value=0.05357142857142857, time used: 4871.6424968242645\n",
      "Current var is [-0.92277522 -0.45341998 -0.16155264  0.40750816 -0.4586906   0.750903\n",
      " -0.783162    0.94215998 -0.04688361  0.70648595]\n",
      "step 1780: T=0.16848802604222568, current_value=0.07142857142857142, time used: 4897.79954624176\n",
      "Current var is [-0.92617044 -1.         -0.51863407  0.7820828  -0.08125934  0.39275357\n",
      " -1.          0.20095717 -0.27670421  0.58147428]\n",
      "step 1790: T=0.16681070755975227, current_value=0.05357142857142857, time used: 4923.483856201172\n",
      "Current var is [-0.99720727 -0.80653922 -0.66868451  0.80084976 -0.11869416 -0.06508514\n",
      " -0.94499722  0.57996675 -0.471948    0.86775627]\n",
      "step 1800: T=0.16515008698369826, current_value=0.03571428571428571, time used: 4949.289050579071\n",
      "Current var is [-0.92476455 -0.77890336 -0.72472776  0.85111697 -0.71501571  0.49625302\n",
      " -0.80191716 -0.25392976 -0.64769679  0.48396567]\n",
      "step 1810: T=0.16350599808440505, current_value=0.07142857142857142, time used: 4975.542871713638\n",
      "Current var is [-0.54797241 -0.80768381 -0.48595965  0.81432912 -0.88757188  0.76482573\n",
      " -0.83417583 -0.27142027 -0.86680096  0.66631637]\n",
      "step 1820: T=0.16187827628705012, current_value=0.08928571428571429, time used: 5001.589177370071\n",
      "Current var is [-0.8284045  -0.94724083 -0.35044258  0.5569677  -1.          0.86698326\n",
      " -0.70105731 -0.29050928 -0.68260744  0.63644276]\n",
      "step 1830: T=0.16026675865517306, current_value=0.05357142857142857, time used: 5027.8300313949585\n",
      "Current var is [-0.6519579  -0.68146001 -0.07766244  0.55026824 -0.89945527  1.\n",
      " -0.29804664 -0.54667889 -0.5226217   0.61654773]\n",
      "step 1840: T=0.15867128387436544, current_value=0.08928571428571429, time used: 5054.6263654232025\n",
      "Current var is [-1.         -1.          0.41952763  0.49877561 -1.          0.94933382\n",
      " -0.5605769  -0.76413294 -0.79178919  0.6349279 ]\n",
      "step 1850: T=0.15709169223612307, current_value=0.05357142857142857, time used: 5081.0926105976105\n",
      "Current var is [-0.89364383 -0.90161436  0.50701346 -0.08266358 -0.83875253  1.\n",
      " -0.51607613 -0.49612143 -0.39118852  0.74246767]\n",
      "step 1860: T=0.1555278256218591, current_value=0.07142857142857142, time used: 5107.502977848053\n",
      "Current var is [-1.         -0.79494501  0.01097464 -0.47248507 -0.6627778   1.\n",
      " -0.53248561 -0.54026024 -0.26895543  0.62663607]\n",
      "step 1870: T=0.1539795274870761, current_value=0.07142857142857142, time used: 5133.922461986542\n",
      "Current var is [-0.90715405 -0.15266371 -0.46453467 -0.29017667 -0.74572425  1.\n",
      " -0.5293089  -0.56286408 -0.33602989  0.81753582]\n",
      "step 1880: T=0.1524466428456959, current_value=0.07142857142857142, time used: 5160.582159996033\n",
      "Current var is [-1.         -0.18043694 -0.4538431  -0.32593114 -0.58176261  1.\n",
      " -0.69958085  0.29774147 -0.57165349  0.86556728]\n",
      "step 1890: T=0.15092901825454527, current_value=0.10714285714285714, time used: 5187.569982290268\n",
      "Current var is [-1.          0.08341749 -0.26543016  0.06079012 -0.58646995  0.44233835\n",
      " -0.05355201  0.54879135 -0.43508608  1.        ]\n",
      "step 1900: T=0.14942650179799616, current_value=0.125, time used: 5213.7429831027985\n",
      "Current var is [-0.74554481 -0.46161833  0.13285916 -0.12843647 -0.28802399  0.54592911\n",
      " -0.22267308  0.54096833  0.38480144  0.86716857]\n",
      "step 1910: T=0.14793894307275884, current_value=0.07142857142857142, time used: 5240.32289981842\n",
      "Current var is [-0.80956947 -0.08463134 -0.37619467 -0.10779972 -0.1971316   0.80271984\n",
      "  0.05058277  0.94904309 -0.19903826  0.20800693]\n",
      "step 1920: T=0.14646619317282628, current_value=0.03571428571428571, time used: 5267.697687625885\n",
      "Current var is [-0.7627188  -0.17840306 -0.18066988 -0.18943489 -0.8746761   0.82694316\n",
      "  0.01243513  0.52406837 -0.12959728  0.520434  ]\n",
      "step 1930: T=0.14500810467456862, current_value=0.05357142857142857, time used: 5294.371340274811\n",
      "Current var is [-9.60907045e-01 -5.51778434e-04 -5.76027389e-01  2.14448222e-01\n",
      " -6.31184300e-01  1.00000000e+00 -1.20803922e-01  4.23436609e-01\n",
      "  3.11847567e-01  7.34155676e-01]\n",
      "step 1940: T=0.14356453162197594, current_value=0.125, time used: 5320.346871614456\n",
      "Current var is [-0.88374206  0.59177251 -0.76469365  0.04843526 -0.62920268  0.90702492\n",
      " -0.08905637  0.84433193  0.25083745  1.        ]\n",
      "step 1950: T=0.14213532951204777, current_value=0.05357142857142857, time used: 5346.386236667633\n",
      "Current var is [-0.84272132  0.22420797 -0.30491636 -0.13684523 -1.          0.79827046\n",
      " -0.15645769  0.94729593 -0.34771284  0.99954936]\n",
      "step 1960: T=0.14072035528032842, current_value=0.05357142857142857, time used: 5373.425921201706\n",
      "Current var is [-0.71255282  0.40223668  0.27767485  0.25983404 -0.83417288  0.52754464\n",
      "  0.44715272  0.52832408 -0.4038644   0.97321529]\n",
      "step 1970: T=0.13931946728658595, current_value=0.05357142857142857, time used: 5400.135450363159\n",
      "Current var is [-0.64431818  0.4122107   0.20586068  0.12504815 -1.          0.34272076\n",
      "  0.39180465  0.78911837 -0.59065916  0.95819463]\n",
      "step 1980: T=0.13793252530063393, current_value=0.08928571428571429, time used: 5426.995614051819\n",
      "Current var is [-0.0412148   0.58185039  0.19836612  0.0899073  -0.98425739  0.50445092\n",
      "  0.30945045  1.         -0.77490856  1.        ]\n",
      "step 1990: T=0.13655939048829419, current_value=0.10714285714285714, time used: 5454.066252231598\n",
      "Current var is [ 0.14785311  0.79791631  0.34694824 -0.19477845 -0.68012801  0.54594436\n",
      "  0.30910645  0.92845635 -0.97209465  1.        ]\n",
      "step 2000: T=0.13519992539749945, current_value=0.07142857142857142, time used: 5481.43408870697\n",
      "Current var is [-0.5480536   0.94497892  0.29072965 -0.47738257 -0.2630333   0.36093882\n",
      "  0.18232538  0.8741518  -0.97130553  0.75440469]\n",
      "step 2010: T=0.13385399394453423, current_value=0.125, time used: 5509.24072432518\n",
      "Current var is [-0.78955653  0.93904902  0.7007649  -0.13358469  0.11294702  0.70009006\n",
      "  0.21538992  0.83970483 -1.          1.        ]\n",
      "step 2020: T=0.13252146140041274, current_value=0.125, time used: 5537.246815443039\n",
      "Current var is [-0.75713595  1.          0.59382093 -0.34812484  0.08960091  0.67139084\n",
      " -0.2843773   0.82902008 -0.96415415  0.65101697]\n",
      "step 2030: T=0.13120219437739242, current_value=0.125, time used: 5565.099326133728\n",
      "Current var is [-0.81972666  0.80535889  0.9902131   0.23197733 -0.39911762  0.93894317\n",
      " -0.76158877  0.79257763 -0.96138208  0.91460574]\n",
      "step 2040: T=0.12989606081562158, current_value=0.08928571428571429, time used: 5592.399318695068\n",
      "Current var is [-0.66031814  0.47869791  1.          0.23908395 -0.26533258  0.91144758\n",
      " -0.68602755  0.2915193  -0.80363551  0.58276044]\n",
      "step 2050: T=0.12860292996992023, current_value=0.14285714285714285, time used: 5619.909745454788\n",
      "Current var is [-0.49407454  0.27062308  0.26989652  0.21976277 -0.27550708  0.96712799\n",
      " -0.54853108  0.32660655 -1.          0.68128459]\n",
      "step 2060: T=0.12732267239669232, current_value=0.10714285714285714, time used: 5647.239646196365\n",
      "Current var is [-0.5237085   0.70140398  0.17589825  0.43889477 -0.75906276  0.64674061\n",
      " -0.49258821  0.5915877  -0.54229398  0.2651132 ]\n",
      "step 2070: T=0.12605515994096825, current_value=0.16071428571428573, time used: 5674.526675224304\n",
      "Current var is [-0.52052351  0.47584048  0.51545992  0.19144417 -0.73174785  0.50140863\n",
      " -0.12022335  0.27209417 -1.         -0.18974209]\n",
      "step 2080: T=0.12480026572357655, current_value=0.08928571428571429, time used: 5702.484898805618\n",
      "Current var is [-0.54931961  0.49546109  1.          0.37599496 -0.77942593  0.96804575\n",
      " -0.06083623  0.58114177 -0.9004146  -0.07319471]\n",
      "step 2090: T=0.12355786412844309, current_value=0.10714285714285714, time used: 5730.283558368683\n",
      "Current var is [-0.75392073  0.69489895  0.97941063  0.15279889 -0.90286566  1.\n",
      " -0.13878202  0.24359114 -0.50503162 -0.02322468]\n",
      "step 2100: T=0.12232783079001679, current_value=0.08928571428571429, time used: 5757.702222824097\n",
      "Current var is [-0.49010386  0.44642002  0.54381285  0.18006758 -0.92680439  0.33720051\n",
      " -0.68100465  0.26685094 -0.21757333 -0.36797945]\n",
      "step 2110: T=0.12111004258082052, current_value=0.14285714285714285, time used: 5785.511914014816\n",
      "Current var is [-0.4007652   0.10789514  0.87036616 -0.38348042 -1.          0.63438781\n",
      " -0.35183865  0.19351005 -0.12638621 -0.23137424]\n",
      "step 2120: T=0.11990437759912595, current_value=0.05357142857142857, time used: 5813.453594207764\n",
      "Current var is [-0.40958897  0.07433285  0.47296139 -0.20933462 -0.52489456  0.35279935\n",
      " -0.22911924 -0.20519256 -0.08404586 -0.38324638]\n",
      "step 2130: T=0.11871071515675106, current_value=0.07142857142857142, time used: 5840.661828517914\n",
      "Current var is [-0.60150658 -0.07752238  0.22800766 -0.6322408  -0.59534323  0.77042163\n",
      "  0.25014766 -0.13320826 -0.03105104 -0.05915742]\n",
      "step 2140: T=0.11752893576697915, current_value=0.07142857142857142, time used: 5868.884348630905\n",
      "Current var is [-0.31551851 -0.30544358 -0.00670355 -0.42966225 -0.71806375  0.52063837\n",
      "  0.28381942 -0.14314964 -0.53152757 -0.12318547]\n",
      "step 2150: T=0.11635892113259806, current_value=0.03571428571428571, time used: 5896.836628198624\n",
      "Current var is [-0.22696747 -0.40011298 -0.07133037 -0.46204896 -0.8973134   0.19643076\n",
      "  0.53818545 -0.19991847 -0.2899945  -0.20982808]\n",
      "step 2160: T=0.1152005541340586, current_value=0.125, time used: 5924.825771808624\n",
      "Current var is [ 0.20711557 -0.47696948  0.22033509 -0.66851996 -0.86228792  0.32880336\n",
      "  0.44174622  0.44070128 -0.3180442  -0.30903006]\n",
      "step 2170: T=0.11405371881775066, current_value=0.14285714285714285, time used: 5952.880740404129\n",
      "Current var is [ 0.05395893 -0.19164349  0.36269387 -0.97042905 -0.86314087  0.84604487\n",
      "  0.18842657  0.675839    0.12963881  0.23244491]\n",
      "step 2180: T=0.11291830038439625, current_value=0.08928571428571429, time used: 5979.9343848228455\n",
      "Current var is [-0.51942097  0.17959202  0.57143327 -0.39136655 -0.86351781  0.70408377\n",
      "  0.19332478  0.45762609  0.29908765  0.27164157]\n",
      "step 2190: T=0.11179418517755794, current_value=0.08928571428571429, time used: 6006.646943330765\n",
      "Current var is [-0.81311002  0.48104064  0.45430058 -0.38332805 -0.74104387  0.74798298\n",
      " -0.12734845  0.01553119  0.23682819  0.2910015 ]\n",
      "step 2200: T=0.11068126067226176, current_value=0.10714285714285714, time used: 6033.311629772186\n",
      "Current var is [-0.64239359  0.28833211 -0.07662973 -0.57748814 -0.90065129  0.6263048\n",
      "  0.58083487 -0.06583542  0.42952107  0.00381116]\n",
      "step 2210: T=0.10957941546373332, current_value=0.08928571428571429, time used: 6060.236648082733\n",
      "Current var is [-0.7672304  -0.10275477 -0.72884513 -0.34688212 -1.          0.93156813\n",
      "  0.75297823 -0.08359254  0.8768036  -0.03194468]\n",
      "step 2220: T=0.10848853925624607, current_value=0.16071428571428573, time used: 6086.997123241425\n",
      "Current var is [-0.50973237 -0.01596646 -0.79155615 -0.00383391 -1.          0.71796436\n",
      "  1.          0.15194896  0.98566333  0.13820078]\n",
      "step 2230: T=0.10740852285208072, current_value=0.08928571428571429, time used: 6114.126573801041\n",
      "Current var is [-1.          0.04937425 -0.43115244  0.14729012 -0.95462387  0.90165991\n",
      "  0.89388321  0.46442178  0.85556517  0.2377513 ]\n",
      "step 2240: T=0.10633925814059425, current_value=0.125, time used: 6141.250068187714\n",
      "Current var is [-0.97863372 -0.03421268 -0.76798969  0.42302981 -0.82701881  0.8427338\n",
      "  0.73603549  0.20802719  1.          0.28339925]\n",
      "step 2250: T=0.10528063808739813, current_value=0.125, time used: 6167.595644235611\n",
      "Current var is [-0.64558949  0.24283978 -0.94592798  0.7501717  -0.80200124  0.77108075\n",
      "  0.36888038  0.01826759  1.          0.27160023]\n",
      "step 2260: T=0.10423255672364394, current_value=0.14285714285714285, time used: 6193.7915852069855\n",
      "Current var is [-0.34344336  0.80259214 -0.82852496 -0.1043977  -0.97667066  1.\n",
      "  0.61572071 -0.1090005   0.71619646  0.70640501]\n",
      "step 2270: T=0.10319490913541585, current_value=0.125, time used: 6219.609568119049\n",
      "Current var is [ 0.15715932  0.54320727 -0.42613014 -0.19440756 -0.83886152  1.\n",
      "  0.06936798  0.40120904  0.55832029  0.64062602]\n",
      "step 2280: T=0.10216759145322862, current_value=0.14285714285714285, time used: 6245.949177503586\n",
      "Current var is [ 0.17477753  0.85254175 -0.44375734 -0.26242562 -1.          0.76703665\n",
      "  0.10844689  0.42125174  0.7251223   0.53956512]\n",
      "step 2290: T=0.10115050084163023, current_value=0.125, time used: 6272.28574514389\n",
      "Current var is [ 0.35747398  0.57282856 -0.47704567  0.14611588 -1.          0.47506616\n",
      " -0.17734146  0.65944977  0.50157826  0.14701388]\n",
      "step 2300: T=0.10014353548890784, current_value=0.14285714285714285, time used: 6299.793178796768\n",
      "Current var is [-0.01205045  0.75452772 -0.84499818  0.05178044 -0.8955326   1.\n",
      " -0.20535288  1.          0.88187227  0.52890177]\n",
      "step 2310: T=0.09914659459689643, current_value=0.14285714285714285, time used: 6327.17294716835\n",
      "Current var is [-0.3356072   0.97058303 -0.62347643 -0.2344603  -0.490898    0.85140902\n",
      "  0.1448335   0.87952759  0.84494194  0.00562675]\n",
      "step 2320: T=0.09815957837088879, current_value=0.08928571428571429, time used: 6354.807010889053\n",
      "Current var is [-0.53623354  0.61528345 -0.20194981 -0.79239102 -0.53123697  0.86158847\n",
      "  0.36929882  0.86250389  0.36376227 -0.21840309]\n",
      "step 2330: T=0.09718238800964599, current_value=0.10714285714285714, time used: 6383.268953800201\n",
      "Current var is [-0.91197676  0.64780653 -0.21803476 -0.98519601 -0.16213416  0.49403081\n",
      "  0.74347348  1.          0.48089727  0.01444043]\n",
      "step 2340: T=0.09621492569550723, current_value=0.16071428571428573, time used: 6411.396726131439\n",
      "Current var is [-0.60841513  0.33455957 -0.01171895 -1.         -0.34385613  0.91916145\n",
      "  0.37093954  1.          0.57985917 -0.18802076]\n",
      "step 2350: T=0.09525709458459827, current_value=0.16071428571428573, time used: 6439.708125591278\n",
      "Current var is [-0.16964928  0.57477214 -0.0373337  -0.82022013 -0.22432506  0.86284885\n",
      "  0.71739343  0.3696681   0.31501535 -0.46836299]\n",
      "step 2360: T=0.09430879879713726, current_value=0.125, time used: 6467.968253612518\n",
      "Current var is [-0.08490942  0.76439189 -0.09792226 -0.71907948 -0.38794532  0.73728641\n",
      "  0.47871736  0.20160919  0.43789161 -0.63972491]\n",
      "step 2370: T=0.093369943407837, current_value=0.08928571428571429, time used: 6496.288511991501\n",
      "Current var is [ 0.10591243  0.8866082   0.02698281 -0.68813247 -0.16268723  0.48800445\n",
      "  0.38114289  0.31528607  0.03428086 -0.25024949]\n",
      "step 2380: T=0.09244043443640296, current_value=0.10714285714285714, time used: 6524.5260145664215\n",
      "Current var is [-0.30823565  0.58539809 -0.07566352 -0.98735147  0.22788005  0.55669197\n",
      "  0.60343979  0.56173976 -0.02566843 -0.37774176]\n",
      "step 2390: T=0.09152017883812565, current_value=0.14285714285714285, time used: 6553.089622735977\n",
      "Current var is [-0.59112478  0.56114609 -0.11664592 -0.86507374 -0.32064569  0.74095089\n",
      "  1.          0.08076255  0.04576922 -0.25567294]\n",
      "step 2400: T=0.09060908449456684, current_value=0.08928571428571429, time used: 6581.40816450119\n",
      "Current var is [-0.61495772  0.60688423  0.15171787 -0.46295499 -0.1205148   0.4902499\n",
      "  0.51949151 -0.04790457  0.36983943 -0.33760629]\n",
      "step 2410: T=0.08970706020433837, current_value=0.125, time used: 6609.008344650269\n",
      "Current var is [-0.59532209  0.14687384  0.07863165 -0.26033582 -0.22226008 -0.00606139\n",
      "  0.77903331  0.35919841 -0.14762083  0.16424743]\n",
      "step 2420: T=0.08881401567397286, current_value=0.14285714285714285, time used: 6637.166042089462\n",
      "Current var is [-0.33589409  1.          0.26205895  0.00633347  0.20126503  0.3300198\n",
      "  0.96005394  0.21933889 -0.25734735  0.56519015]\n",
      "step 2430: T=0.08792986150888515, current_value=0.125, time used: 6665.370603561401\n",
      "Current var is [-0.59523512  0.7091582   0.19398936 -0.15479825  0.32988558  0.66793226\n",
      "  0.17412084  0.30530162 -0.23058734  0.61236767]\n",
      "step 2440: T=0.08705450920442395, current_value=0.08928571428571429, time used: 6692.676545619965\n",
      "Current var is [-0.52404003  0.92154953  0.84346151 -0.34673022  0.14974816  0.84252188\n",
      " -0.389541   -0.16211178  0.48756436  0.40378263]\n",
      "step 2450: T=0.08618787113701233, current_value=0.0, time used: 6719.583617210388\n",
      "Current var is [-0.91603651  0.63110476  0.4016814  -0.28801034  0.09488935  0.83528493\n",
      " -0.65563491 -0.31247112  0.61176042  0.32796677]\n",
      "step 2460: T=0.0853298605553766, current_value=0.07142857142857142, time used: 6746.196443557739\n",
      "Current var is [-0.97954733  0.55957488  0.27615853 -0.29132352 -0.5536641   0.36102382\n",
      " -0.59155142 -0.39196457  0.59945904  0.68520264]\n",
      "step 2470: T=0.08448039157186234, current_value=0.125, time used: 6772.494110107422\n",
      "Current var is [-0.99068912  0.64160922  0.36129636 -0.40226136 -0.81812778  0.64968433\n",
      " -0.75551465 -0.22770429  0.79859026  0.77697202]\n",
      "step 2480: T=0.08363937915383707, current_value=0.14285714285714285, time used: 6798.506546735764\n",
      "Current var is [-0.95656189  0.6159562   0.04509655 -0.64067905 -0.81000231  0.2239111\n",
      " -0.25645759 -0.223947    0.28844425  0.82743975]\n",
      "step 2490: T=0.08280673911517833, current_value=0.14285714285714285, time used: 6824.670535802841\n",
      "Current var is [-0.76309958  1.          0.02878748 -0.15683    -0.439576    0.56395912\n",
      " -1.         -0.65505664  0.01036884  0.8513456 ]\n",
      "step 2500: T=0.0819823881078466, current_value=0.14285714285714285, time used: 6851.606492996216\n",
      "Current var is [-0.37029116  0.85590565  0.37644129  0.22543852 -0.36826404  0.55554532\n",
      " -0.70825573  0.04174157 -0.05767749 -0.07038104]\n",
      "step 2510: T=0.08116624361354208, current_value=0.10714285714285714, time used: 6878.722015142441\n",
      "Current var is [-0.66920947  0.89207114  0.8311795   0.06783281 -0.22102779  0.22481874\n",
      " -0.86043893 -0.2083857  -0.11510424 -0.10761878]\n",
      "step 2520: T=0.0803582239354445, current_value=0.05357142857142857, time used: 6905.33583521843\n",
      "Current var is [-0.56384305  0.98596099  0.54053117 -0.35190975  0.05498381  0.47501073\n",
      " -1.          0.30398452  0.45504502 -0.19988808]\n",
      "step 2530: T=0.07955824819003528, current_value=0.125, time used: 6932.716567993164\n",
      "Current var is [-0.63476169  0.96134163  1.         -0.38997059 -0.22318323  0.22150434\n",
      " -0.86713662  0.58143583  0.72956321 -0.0428764 ]\n",
      "step 2540: T=0.07876623629900088, current_value=0.125, time used: 6959.869976758957\n",
      "Current var is [-0.46353203  0.840431    0.69574569 -0.178028   -0.09110855  0.68349458\n",
      " -0.95624949  0.65484673  1.         -0.22731689]\n",
      "step 2550: T=0.07798210898121706, current_value=0.05357142857142857, time used: 6987.552942752838\n",
      "Current var is [-0.03719884  0.51725111  0.61196747 -0.20765592  0.18664306  0.56564991\n",
      " -0.56084431  0.34838284  0.77398685 -0.0707492 ]\n",
      "step 2560: T=0.07720578774481257, current_value=0.10714285714285714, time used: 7015.24787402153\n",
      "Current var is [ 0.42442882  0.88967799  0.55093198 -0.01832363 -0.2424597   0.7171379\n",
      " -1.          0.36653783  0.78757635 -0.20893031]\n",
      "step 2570: T=0.0764371948793122, current_value=0.08928571428571429, time used: 7042.563917398453\n",
      "Current var is [ 0.65889302  0.92547425  0.74480602  0.01838619 -0.46840265  0.80220226\n",
      " -0.80871943  0.28220273  0.5439261  -0.06541144]\n",
      "step 2580: T=0.07567625344785783, current_value=0.10714285714285714, time used: 7070.281796455383\n",
      "Current var is [ 0.83252601  0.7524177   0.80650639 -0.35172715 -0.38655812  0.81707067\n",
      " -1.          0.5167099   0.80082408 -0.02442616]\n",
      "step 2590: T=0.07492288727950695, current_value=0.14285714285714285, time used: 7097.904914855957\n",
      "Current var is [ 0.88433359  0.67737564  0.21951056 -0.54558133 -0.61432435  1.\n",
      " -0.92808559  0.6805974   0.95761584  0.2173347 ]\n",
      "step 2600: T=0.07417702096160793, current_value=0.08928571428571429, time used: 7125.276676654816\n",
      "Current var is [ 1.          0.50533293  0.15741557 -0.13436935 -0.55074653  0.84613939\n",
      " -0.92879687  0.89821954  1.         -0.7174751 ]\n",
      "step 2610: T=0.0734385798322511, current_value=0.08928571428571429, time used: 7153.214995145798\n",
      "Current var is [ 0.92175055  0.71737363 -0.21903635 -0.35033045 -0.75171973  0.79113773\n",
      " -0.8130237   0.49565448  0.7562371  -0.95631106]\n",
      "step 2620: T=0.07270748997279507, current_value=0.017857142857142856, time used: 7180.745329618454\n",
      "Current var is [ 0.90096952  0.37171007 -1.         -0.65536901 -0.67596954  0.52961149\n",
      " -0.96256938  0.17832431  0.84372551 -0.77282536]\n",
      "step 2630: T=0.07198367820046736, current_value=0.05357142857142857, time used: 7208.222841978073\n",
      "Current var is [ 0.73703842 -0.16591628 -0.89139339 -0.50001536 -0.73489624  0.35366856\n",
      " -0.94604739 -0.06267848  0.75046917 -0.83718323]\n",
      "step 2640: T=0.07126707206103877, current_value=0.03571428571428571, time used: 7235.375224351883\n",
      "Current var is [ 0.69451557 -0.17048726 -0.52685794 -0.43336217 -0.93015144  0.19176476\n",
      " -1.          0.35816509  0.38040667 -0.91894792]\n",
      "step 2650: T=0.07055759982157063, current_value=0.125, time used: 7262.851767778397\n",
      "Current var is [ 1.         -0.0760674  -0.37249754 -0.45695521 -0.12352455  0.23729594\n",
      " -0.71688701  0.01716809  0.0341782  -0.75445031]\n",
      "step 2660: T=0.06985519046323424, current_value=0.07142857142857142, time used: 7290.284406661987\n",
      "Current var is [ 0.62120065 -0.40492795 -0.45669813  0.02496324 -0.48414823  0.18498332\n",
      " -0.63429626 -0.2687344  -0.53307589 -0.21800697]\n",
      "step 2670: T=0.0691597736742019, current_value=0.125, time used: 7317.4437687397\n",
      "Current var is [ 0.55136001 -0.16270029 -0.57330314  0.06596056 -0.2348364   0.45007106\n",
      " -0.24483714  0.05069746 -0.16209428 -0.49493282]\n",
      "step 2680: T=0.0684712798426085, current_value=0.16071428571428573, time used: 7345.212503910065\n",
      "Current var is [ 0.55783767  0.25059017 -0.82767297  0.12884298 -0.73575113  0.38454521\n",
      " -0.35681148  0.30727966 -0.52292819 -0.61878043]\n",
      "step 2690: T=0.06778964004958349, current_value=0.05357142857142857, time used: 7372.725918292999\n",
      "Current var is [ 1.         -0.30754718 -0.84422434  0.03777863 -0.83026711  0.80709362\n",
      " -0.46459871 -0.22461526 -0.22339395 -0.7215783 ]\n",
      "step 2700: T=0.06711478606235183, current_value=0.03571428571428571, time used: 7400.2233855724335\n",
      "Current var is [ 1.         -0.21513751 -0.65387386 -0.17940972 -0.3781424   0.0485287\n",
      " -0.0303853  -0.15196165 -0.71590912 -0.93363338]\n",
      "step 2710: T=0.066446650327404, current_value=0.08928571428571429, time used: 7427.832592010498\n",
      "Current var is [ 1.          0.04858258 -0.70332463 -0.21557361 -0.68537878  0.13115677\n",
      " -0.03941704 -0.28049416 -0.58258432 -0.86748531]\n",
      "step 2720: T=0.06578516596373372, current_value=0.125, time used: 7455.44873714447\n",
      "Current var is [ 0.81196067 -0.04100838 -0.37318335 -0.17590581 -0.26716815 -0.37557155\n",
      "  0.32618394  0.032891   -0.59755397 -0.85018659]\n",
      "step 2730: T=0.06513026675614315, current_value=0.10714285714285714, time used: 7483.133659124374\n",
      "Current var is [ 0.86149295  0.42427995 -0.454438   -0.60180011  0.25847631 -0.47552763\n",
      "  0.18853144  0.14512471 -0.62512226 -0.74885423]\n",
      "step 2740: T=0.06448188714861469, current_value=0.05357142857142857, time used: 7510.342928409576\n",
      "Current var is [ 0.86975196  0.29635852 -0.43466828 -0.80891296 -0.07572628 -0.81264446\n",
      " -0.38275786 -0.09356979 -0.88143313 -0.38283875]\n",
      "step 2750: T=0.06383996223774874, current_value=0.05357142857142857, time used: 7537.018585443497\n",
      "Current var is [ 0.69325186  0.36585251 -0.38958641 -0.94730647  0.02585144 -0.59756949\n",
      "  0.61656566 -0.48674433 -0.61717258 -0.28922301]\n",
      "step 2760: T=0.0632044277662668, current_value=0.07142857142857142, time used: 7564.570900678635\n",
      "Current var is [ 0.97742101  0.57587871 -0.18853323 -0.78437188  0.51541313 -0.84837544\n",
      "  0.90022939 -0.66293509 -0.52478259 -0.49949082]\n",
      "step 2770: T=0.06257522011657929, current_value=0.08928571428571429, time used: 7592.360572576523\n",
      "Current var is [ 0.25563603  0.64971478 -0.01032546 -1.          0.28880937 -1.\n",
      "  1.         -1.         -0.63703801  0.09621692]\n",
      "step 2780: T=0.061952276304417374, current_value=0.08928571428571429, time used: 7620.098388910294\n",
      "Current var is [ 0.64486902  0.62228091  0.01559083 -1.          0.22473299 -0.76205874\n",
      "  0.72779099 -1.         -0.84238211 -0.25921187]\n",
      "step 2790: T=0.06133553397252812, current_value=0.125, time used: 7648.245074510574\n",
      "Current var is [ 0.9657222   1.          0.05981002 -0.89569073  0.30745715 -0.76235397\n",
      "  1.         -0.55879757 -1.          0.23309721]\n",
      "step 2800: T=0.060724931384432544, current_value=0.08928571428571429, time used: 7676.121558189392\n",
      "Current var is [ 1.          0.80511134  0.08608492 -1.          0.2603266  -0.92169457\n",
      "  0.95303018 -0.59632065 -0.85583832 -0.28668443]\n",
      "step 2810: T=0.060120407418245696, current_value=0.05357142857142857, time used: 7703.574132442474\n",
      "Current var is [ 0.81352371  0.60804017 -0.41353914 -0.96828136  0.07847476 -0.77755966\n",
      "  0.6591604  -0.47604295 -0.28140251  0.06335838]\n",
      "step 2820: T=0.05952190156055832, current_value=0.07142857142857142, time used: 7731.080572128296\n",
      "Current var is [ 1.          0.95071856 -0.00285051 -0.79976612  0.13204259 -0.90145629\n",
      "  0.8179715  -0.91438317  0.06017871 -0.31084168]\n",
      "step 2830: T=0.058929353900379386, current_value=0.05357142857142857, time used: 7758.322676897049\n",
      "Current var is [ 0.9703702   0.96368113  0.41536732 -1.         -0.53202769 -0.67504078\n",
      "  0.83018305 -0.71242687  0.34843784 -0.11810808]\n",
      "step 2840: T=0.058342705123138966, current_value=0.03571428571428571, time used: 7785.292582035065\n",
      "Current var is [ 0.97536061  0.92032466  0.59476204 -0.86202268 -0.84284599 -0.62628471\n",
      "  0.82456301 -0.71663807  0.2420737  -0.08634363]\n",
      "step 2850: T=0.057761896504750776, current_value=0.14285714285714285, time used: 7812.044041156769\n",
      "Current var is [ 1.          0.64523381 -0.23123975 -0.52144405 -0.51108185 -0.06681385\n",
      "  1.         -0.83409387 -0.06580314  0.17402318]\n",
      "step 2860: T=0.05718686990573386, current_value=0.08928571428571429, time used: 7839.788822412491\n",
      "Current var is [ 0.531003    0.17588449  0.30476121 -0.87903965 -0.01763604  0.57922361\n",
      "  0.83070907 -0.69136666 -0.37566772  0.01240301]\n",
      "step 2870: T=0.05661756776539273, current_value=0.07142857142857142, time used: 7868.030302524567\n",
      "Current var is [ 1.         -0.29633357  0.26533231 -0.47807396 -0.03701725  1.\n",
      "  0.93520536 -0.96353748 -0.08932998 -0.16626784]\n",
      "step 2880: T=0.056053933096055546, current_value=0.08928571428571429, time used: 7895.500841617584\n",
      "Current var is [ 1.         -0.30437931  0.0846018  -0.15147704 -0.23134608  0.73833956\n",
      "  0.81737758 -0.98707697  0.55095896 -0.06049124]\n",
      "step 2890: T=0.05549590947736956, current_value=0.05357142857142857, time used: 7923.0242211818695\n",
      "Current var is [ 0.98650143 -0.54148777  0.56274803 -0.15091191 -0.06646053  1.\n",
      "  0.51225746 -1.          0.36452807 -0.02759027]\n",
      "step 2900: T=0.05494344105065337, current_value=0.0, time used: 7951.007484197617\n",
      "Current var is [ 0.9641446  -0.25657105  0.47154214  0.06054398  0.25307176  0.66888312\n",
      "  0.62640945 -0.81958673  0.62599673 -0.64484887]\n",
      "step 2910: T=0.05439647251330548, current_value=0.05357142857142857, time used: 7978.9572649002075\n",
      "Current var is [ 0.83279627 -0.20064888  0.52539264 -0.09635746  0.68308026  0.83809148\n",
      "  0.6573322  -0.8578567   0.99756154 -0.16898215]\n",
      "step 2920: T=0.05385494911326839, current_value=0.07142857142857142, time used: 8007.405180215836\n",
      "Current var is [ 1.          0.5877528   0.73907586  0.03476619  0.72307718  0.60620676\n",
      "  0.17741182 -0.39337266  0.94397717 -0.07940718]\n",
      "step 2930: T=0.05331881664354788, current_value=0.08928571428571429, time used: 8035.306560516357\n",
      "Current var is [ 0.65477713  0.40368738  0.64501798  0.55976421  0.10692651  0.63833809\n",
      " -0.15593154 -0.3225471   0.92086371  0.05226109]\n",
      "step 2940: T=0.05278802143678689, current_value=0.10714285714285714, time used: 8062.7352130413055\n",
      "Current var is [ 0.35883652  0.58879655  0.84399178  0.79915731 -0.11474526  0.71333547\n",
      "  0.28283861 -0.40533037  0.45483831 -0.17613824]\n",
      "step 2950: T=0.0522625103598933, current_value=0.08928571428571429, time used: 8090.246626615524\n",
      "Current var is [-0.06437273  0.26290714  0.44798353  0.68454355 -0.48626791  0.89982753\n",
      "  0.52972671 -0.1447319   0.93213424 -0.37252589]\n",
      "step 2960: T=0.051742230808721285, current_value=0.10714285714285714, time used: 8118.199865579605\n",
      "Current var is [ 0.32999345  0.58866093  0.06348267  0.41723293 -0.06036062  0.78222037\n",
      "  0.06057498  0.06045845  0.5411397   0.09848118]\n",
      "step 2970: T=0.05122713070280561, current_value=0.08928571428571429, time used: 8145.638446807861\n",
      "Current var is [ 0.17125588  0.42291581 -0.71657151  0.62713655 -0.80171153  0.86874515\n",
      " -0.77598576 -0.19596583  0.12859063 -0.41368406]\n",
      "step 2980: T=0.050717158480148294, current_value=0.05357142857142857, time used: 8172.757953643799\n",
      "Current var is [ 0.12237035  0.69776344 -1.          0.7481048  -0.86111045  0.40547938\n",
      " -0.96149348 -0.5551555   0.18581038 -0.71405842]\n",
      "step 2990: T=0.05021226309205723, current_value=0.017857142857142856, time used: 8199.918306589127\n",
      "Current var is [-0.31592263  1.         -1.          0.30767805 -0.88079691  0.34530045\n",
      " -0.44362989 -0.15500608  0.30872866 -0.65031455]\n",
      "step 3000: T=0.04971239399803616, current_value=0.03571428571428571, time used: 8227.300083637238\n",
      "Current var is [-0.67769149  1.         -0.95096583  0.14676487 -0.29645984  0.52433767\n",
      "  0.16760278 -0.3111651   0.78395113 -0.5960777 ]\n",
      "step 3010: T=0.04921750116072552, current_value=0.125, time used: 8254.26994752884\n",
      "Current var is [-3.97394113e-01  7.39014323e-01 -6.64553106e-01  1.61920499e-01\n",
      " -5.69605826e-04  3.30550478e-01  1.66718249e-01 -5.25012924e-01\n",
      "  7.21703866e-01 -2.80545975e-01]\n",
      "step 3020: T=0.04872753504089364, current_value=0.05357142857142857, time used: 8281.46418762207\n",
      "Current var is [-0.69289159  0.86236943 -0.99753124 -0.16579247 -0.58088543  0.18964135\n",
      "  0.16156942 -0.51465386  0.66210107 -0.52872897]\n",
      "step 3030: T=0.04824244659247785, current_value=0.08928571428571429, time used: 8308.903827905655\n",
      "Current var is [-0.7414653   0.89587452 -0.99813223 -0.50269154  0.04773094  0.31253207\n",
      "  0.68733862 -0.24864469  0.4080172  -0.55707494]\n",
      "step 3040: T=0.04776218725767491, current_value=0.07142857142857142, time used: 8336.559873819351\n",
      "Current var is [-0.50554796  0.56973186 -0.83736526 -0.42327087 -0.26145705  0.43261934\n",
      "  0.87309188 -0.09752596  0.16574336 -0.81972071]\n",
      "step 3050: T=0.047286708962080315, current_value=0.125, time used: 8364.776371717453\n",
      "Current var is [ 0.11114354  0.90009639 -0.32407715 -0.68566533 -0.20783265  0.94836258\n",
      "  1.          0.15771823  0.18921441 -0.95098646]\n",
      "step 3060: T=0.04681596410987603, current_value=0.07142857142857142, time used: 8393.564416408539\n",
      "Current var is [ 0.29546685  0.40050761  0.07387982 -0.80125499 -0.25887851  1.\n",
      "  0.71559602  0.30255111  0.07334146 -0.8450798 ]\n",
      "step 3070: T=0.04634990557906609, current_value=0.10714285714285714, time used: 8422.004355430603\n",
      "Current var is [ 0.92247698  0.52260362  0.22307127 -0.80594984 -0.57934679  1.\n",
      "  0.99323767 -0.46477437  0.01891651 -0.93250423]\n",
      "step 3080: T=0.04588848671675962, current_value=0.10714285714285714, time used: 8449.972552061081\n",
      "Current var is [ 0.71250268  0.27114173  0.64457919 -0.76926476 -0.58481567  0.88944928\n",
      "  0.66094742 -0.01940957  0.06127324 -1.        ]\n",
      "step 3090: T=0.045431661334500904, current_value=0.125, time used: 8478.50424695015\n",
      "Current var is [ 0.78779375  0.12672491  0.28236563 -0.86920617 -0.50389721  0.85381958\n",
      "  0.63509966  0.07575572 -0.29925849 -1.        ]\n",
      "step 3100: T=0.0449793837036458, current_value=0.08928571428571429, time used: 8506.936207294464\n",
      "Current var is [ 0.32109333 -0.13307645  0.07752169 -0.83543705 -0.42220959  0.19060955\n",
      "  0.072265    0.421399   -0.36599238 -0.74800351]\n",
      "step 3110: T=0.0445316085507843, current_value=0.125, time used: 8535.014115810394\n",
      "Current var is [ 0.26621726  0.00865957 -0.5512371  -0.87017753 -0.76812934  0.64998281\n",
      "  0.56485914  0.60649602 -0.241204   -0.6017173 ]\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# define your own schedule and halt condition\n",
    "solution, record = simulated_annealing(\n",
    "    np.array([-1, 1, -0.3, -0.2, 0.7, -0.2, -0.2, -0.3, 0.4, -0.2])\n",
    "    ,neighbour_cnt=4\n",
    ")\n",
    "solution"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": true
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "# visualize the curve\n",
    "plt.plot(record)\n",
    "plt.xlabel(\"time step\")\n",
    "plt.ylabel(\"value\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "## Deprecated: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "def imerge(a, b):\n",
    "    i1 = iter(a)\n",
    "    i2 = iter(b)\n",
    "    while True:\n",
    "        try:\n",
    "            yield i1.next()\n",
    "            yield i2.next()\n",
    "        except StopIteration:\n",
    "            return\n",
    "\n",
    "\n",
    "for i in imerge(range(10), range(8)):\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "def schedule(t):\n",
    "    T = 1000\n",
    "    while True:\n",
    "        yield T\n",
    "        T *= 0.98\n",
    "\n",
    "\n",
    "def simulated_annealing(InitialVars, rounds):\n",
    "    current = InitialVars\n",
    "    for t in range(rounds):\n",
    "        T = schedule(t)\n",
    "        if T <= 10:\n",
    "            return current\n",
    "        for var in imerge(current, model.neighbours(current))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}